<me:UIWGBST x:Class="WPFExcelReport.TVWG02"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"   
                     xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM" 
                    xmlns:WF="clr-namespace:WPFExcelReport;assembly=TWAFARBEN" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
                    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    Background="White"  
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIWGBST.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIWGBST.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" >
            <WrapPanel>
                <Button  Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="24" VerticalAlignment="Top" >
                    <Button.Background>
                     <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                    </Button.Background>
                  </Button>  
                <Grid Margin="10,0,0,0"  VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=年}}"/> 
                    <ex:TXT72 MaxLength="4" Grid.Column="1"  Text="{Binding YYYY}" MinWidth="40" Width="Auto" />
                </Grid>
                <Grid Margin="10,0,0,0"  VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=月}}"></TextBlock>
                    <ex:TXT72 MaxLength="2" Grid.Column="1"  Text="{Binding MM}" MinWidth="24" Width="Auto" />
                </Grid>
                <Grid Margin="10,0,0,0"  VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=库}}"></TextBlock>
                    <ex:TXT72 MaxLength="2" Grid.Column="1"  Text="{Binding LO}" MinWidth="24" Width="Auto" />
                </Grid>
                <Grid Margin="10,0,0,0"  VerticalAlignment="Top">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="Auto"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <WS:TSWS02 Name="cWS02" Grid.Row="0"   />
                 </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition> 
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <WF:TSWS06  Grid.Row="0"   dwWS="{Binding dwWS,ElementName=cWS02}" dwWF="{Binding dwWF,ElementName=TV}" /> 
                </Grid>  
        </WrapPanel>  
        </StackPanel>
        <DataGrid  Grid.Row="1"  
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible"  Margin="0,0,0,0"
                    > 
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=WGLO}" Header="{Binding Source={Localization:Translate Word=库}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WGMJJ}" Header="{Binding Source={Localization:Translate Word=年}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WGMM}" Header="{Binding Source={Localization:Translate Word=月}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WGART}" Header="{Binding Source={Localization:Translate Word=面料}}"  Width="Auto" /> 
                <DataGridTextColumn Binding="{Binding Path=WGFARBE}" Header="{Binding Source={Localization:Translate Word=色号}}"  Width="Auto" /> 
                <DataGridTextColumn Binding="{Binding Path=WGME10,Converter={StaticResource d100}}" Header="{Binding Source={Localization:Translate Word=入库}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WGME20,Converter={StaticResource d100}}" Header="{Binding Source={Localization:Translate Word=出库}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WGME60,Converter={StaticResource d100}}" Header="{Binding Source={Localization:Translate Word=锁定}}"  Width="Auto" /> 
            </DataGrid.Columns>
        </DataGrid  >
    </Grid>
</me:UIWGBST>
